<!DOCTYPE html>
<html>
<head>
    <title>WebSocket/SockJS Echo Sample (Adapted from Tomcat's echo sample)</title>

    <script src="./libs/websocket/swfobject.js"></script>
    <script src="./libs/websocket/web_socket.js"></script>

    <script type="text/javascript">
        // Let the library know where WebSocketMain.swf is:
        WEB_SOCKET_SWF_LOCATION = "WebSocketMain.swf";
        // Write your code in the same way as for native WebSocket:
        var ws = new WebSocket("ws://127.0.0.1:8080/websocket");
        ws.onopen = function() {
            ws.send("Hello");  // Sends a message.
        };
        ws.onmessage = function(e) {
            // Receives a message.
            alert(e.data);
        };
        ws.onclose = function() {
            alert("closed");
        };
    </script>
</head>
<body>

</body>
</html>  